function thetar = find_thetar(Deltax,Deltay)

         if     ((Deltay >= 0 ) && (Deltax >= 0 ))
            thetar = atan(abs(Deltay/Deltax)) ;
         elseif ((Deltay >= 0 ) && (Deltax < 0 ))
            thetar = atan(abs(Deltax/Deltay)) + 1*pi/2;
         elseif ((Deltay < 0 ) && (Deltax >= 0 ))
            thetar = atan(abs(Deltax/Deltay)) + 3*pi/2;
         elseif ((Deltay < 0 ) && (Deltax < 0 ))
            thetar = atan(abs(Deltay/Deltax)) + 2*pi/2;
         end

end